package com.guozcc.bootweb.platform.job;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * EnableScheduling+@Scheduled  SpringBoot原生调度，不依赖ZK
 */

@Component
//@EnableScheduling  开关
public class TestJob {

    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @Scheduled(cron = "0/1 * * * * *")
    public void demoJob() throws InterruptedException {
        log.info("============>demoJob执行");
        Thread.sleep(1000*5);
    }
}
